package core

import (
	"gitee.com/huanghua_2017/blade/build"
	"gitee.com/huanghua_2017/blade/state"
)

func (slf *Core) Version() string {
	return build.Version
}

func (slf *Core) GetALiveConn() int64 {
	return slf.State.GetALiveConn()
}

func (slf *Core) ProxyConnsInfo() map[string]int64 {
	return slf.State.ProxyConnsInfo()
}

func (slf *Core) GetSlaveInfo() map[string]string {
	ret := map[string]string{}
	conns := slf.State.SlaveConns()
	for k, v := range conns {
		ret[k] = v.Resaddr
	}
	return ret
}

func (slf *Core) SlaveConnsInfo() []*state.SlaveConn {
	return slf.State.SlaveConnsInfo()
}
